home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / info / xemacs.info-5.z / xemacs.info-5
Encoding:
GNU Info File  |  1998-05-21  |  50.0 KB  |  1,187 lines

  1. This is Info file ../../info/xemacs.info, produced by Makeinfo version
  2. 1.68 from the input file xemacs.texi.
  3.  
  4.    This file documents the XEmacs editor.
  5.  
  6.    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.  Copyright (C)
  7. 1991, 1992, 1993, 1994 Lucid, Inc.  Copyright (C) 1993, 1994 Sun
  8. Microsystems, Inc.  Copyright (C) 1995 Amdahl Corporation.
  9.  
  10.    Permission is granted to make and distribute verbatim copies of this
  11. manual provided the copyright notice and this permission notice are
  12. preserved on all copies.
  13.  
  14.    Permission is granted to copy and distribute modified versions of
  15. this manual under the conditions for verbatim copying, provided also
  16. that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
  17. General Public License" are included exactly as in the original, and
  18. provided that the entire resulting derived work is distributed under the
  19. terms of a permission notice identical to this one.
  20.  
  21.    Permission is granted to copy and distribute translations of this
  22. manual into another language, under the above conditions for modified
  23. versions, except that the sections entitled "The GNU Manifesto",
  24. "Distribution" and "GNU General Public License" may be included in a
  25. translation approved by the author instead of in the original English.
  26.  
  27. 
  28. File: xemacs.info,  Node: Active Regions,  Prev: X Cut Buffers,  Up: Using X Selections
  29.  
  30. Active Regions
  31. --------------
  32.  
  33.    By default, both the text you select in an Emacs buffer using the
  34. click-and-drag mechanism and text you select by setting point and the
  35. mark is highlighted. You can use Emacs region commands as well as the
  36. Cut and Copy commands on the highlighted region you selected with the
  37. mouse.
  38.  
  39.    If you prefer, you can make a distinction between text selected with
  40. the mouse and text selected with point and the mark by setting the
  41. variable `zmacs-regions' to `nil'.  In that case:
  42.  
  43.    * The text selected with the mouse becomes both the X selection and
  44.      the Emacs selected region. You can use menu-bar commands as well
  45.      as Emacs region commands on it.
  46.  
  47.    * The text selected with point and the mark is not highlighted. You
  48.      can only use Emacs region commands on it, not the menu-bar items.
  49.  
  50.    Active regions originally come from Zmacs, the Lisp Machine editor.
  51. The idea behind them is that commands can only operate on a region when
  52. the region is in an "active" state.  Put simply, you can only operate on
  53. a region that is highlighted.
  54.  
  55.    The variable `zmacs-regions' checks whether LISPM-style active
  56. regions should be used.  This means that commands that operate on the
  57. region (the area between point and the mark) only work while the region
  58. is in the active state, which is indicated by highlighting.  Most
  59. commands causes the region to not be in the active state; for example,
  60. `C-w' only works immediately after activating the region.
  61.  
  62.    More specifically:
  63.    * Commands that operate on the region only work if the region is
  64.      active.
  65.  
  66.    * Only a very small set of commands causes the region to become
  67.      active-- those commands whose semantics are to mark an area, such
  68.      as `mark-defun'.
  69.  
  70.    * The region is deactivated after each command that is executed,
  71.      except that motion commands do not change whether the region is
  72.      active or not.
  73.  
  74.    `set-mark-command' (`C-SPC') pushes a mark and activates the region.
  75. Moving the cursor with normal motion commands (`C-n', `C-p', etc.)
  76. will cause the region between point and the recently-pushed mark to be
  77. highlighted.  It will remain highlighted until some non-motion command
  78. is executed.
  79.  
  80.    `exchange-point-and-mark' (`C-x C-x') activates the region.  So if
  81. you mark a region and execute a command that operates on it, you can
  82. reactivate the same region with `C-x C-x' (or perhaps `C-x C-x C-x
  83. C-x') to operate on it again.
  84.  
  85.    Generally, commands that push marks as a means of navigation, such as
  86. `beginning-of-buffer' (`M-<') and `end-of-buffer' (`M->'), do not
  87. activate the region.  However, commands that push marks as a means of
  88. marking an area of text, such as `mark-defun' (`M-C-h'), `mark-word'
  89. (`M-@'), and `mark-whole-buffer' (`C-x h'), do activate the region.
  90.  
  91.    When `zmacs-regions' is `t', there is no distinction between the
  92. primary X selection and the active region selected by point and the
  93. mark.  To see this, set the mark (<C-SPC>) and move the cursor with any
  94. cursor-motion command: the region between point and mark is
  95. highlighted, and you can watch it grow and shrink as you move the
  96. cursor.
  97.  
  98.    Any other commands besides cursor-motion commands (such as inserting
  99. or deleting text) will cause the region to no longer be active; it will
  100. no longer be highlighted, and will no longer be the primary selection.
  101. Errors also remove highlighting from a region.
  102.  
  103.    Commands that require a region (such as `C-w') signal an error if
  104. the region is not active.  Certain commands cause the region to be in
  105. its active state.  The most common ones are `push-mark' (<C-SPC>) and
  106. `exchange-point-and-mark' (`C-x C-x').
  107.  
  108.    When `zmacs-regions' is `t', programs can be non-intrusive on the
  109. state of the region by setting the variable `zmacs-region-stays' to a
  110. non-`nil' value.  If you are writing a new Emacs command that is
  111. conceptually a "motion" command and should not interfere with the
  112. current highlightedness of the region, then you may set this variable.
  113. It is reset to `nil' after each user command is executed.
  114.  
  115.    When `zmacs-regions' is `t', programs can make the region between
  116. point and mark go into the active (highlighted) state by using the
  117. function `zmacs-activate-region'. Only a small number of commands
  118. should ever do this.
  119.  
  120.    When `zmacs-regions' is `t', programs can deactivate the region
  121. between point and the mark by using `zmacs-deactivate-region'.  Note:
  122. you should not have to call this function; the command loop calls it
  123. when appropriate.
  124.  
  125. 
  126. File: xemacs.info,  Node: Accumulating Text,  Next: Rectangles,  Prev: Using X Selections,  Up: Top
  127.  
  128. Accumulating Text
  129. =================
  130.  
  131.    Usually you copy or move text by killing it and yanking it, but
  132. there are other ways that are useful for copying one block of text in
  133. many places, or for copying many scattered blocks of text into one
  134. place.
  135.  
  136.    If you like, you can accumulate blocks of text from scattered
  137. locations either into a buffer or into a file.  The relevant commands
  138. are described here.  You can also use Emacs registers for storing and
  139. accumulating text.  *Note Registers::.
  140.  
  141. `M-x append-to-buffer'
  142.      Append region to contents of specified buffer (`append-to-buffer').
  143.  
  144. `M-x prepend-to-buffer'
  145.      Prepend region to contents of specified buffer.
  146.  
  147. `M-x copy-to-buffer'
  148.      Copy region into specified buffer, deleting that buffer's old
  149.      contents.
  150.  
  151. `M-x insert-buffer'
  152.      Insert contents of specified buffer into current buffer at point.
  153.  
  154. `M-x append-to-file'
  155.      Append region to the end of the contents of specified file.
  156.  
  157.    To accumulate text into a buffer, use the command `M-x
  158. append-to-buffer', which inserts a copy of the region into the buffer
  159. BUFFERNAME, at the location of point in that buffer.  If there is no
  160. buffer with the given name, one is created.
  161.  
  162.    If you append text to a buffer that has been used for editing, the
  163. copied text goes to the place where point is.  Point in that buffer is
  164. left at the end of the copied text, so successive uses of
  165. `append-to-buffer' accumulate the text in the specified buffer in the
  166. same order as they were copied.  Strictly speaking, this command does
  167. not always append to the text already in the buffer; but if this command
  168. is the only command used to alter a buffer, it does always append to the
  169. existing text because point is always at the end.
  170.  
  171.    `M-x prepend-to-buffer' is similar to `append-to-buffer', but point
  172. in the other buffer is left before the copied text, so successive
  173. prependings add text in reverse order.  `M-x copy-to-buffer' is
  174. similar, except that any existing text in the other buffer is deleted,
  175. so the buffer is left containing just the text newly copied into it.
  176.  
  177.    You can retrieve the accumulated text from that buffer with `M-x
  178. insert-buffer', which takes BUFFERNAME as an argument.  It inserts a
  179. copy of the text in buffer BUFFERNAME into the selected buffer.  You
  180. could alternatively select the other buffer for editing, perhaps moving
  181. text from it by killing or with `append-to-buffer'.  *Note Buffers::,
  182. for background information on buffers.
  183.  
  184.    Instead of accumulating text within Emacs in a buffer, you can append
  185. text directly into a file with `M-x append-to-file', which takes
  186. FILE-NAME as an argument.  It adds the text of the region to the end of
  187. the specified file.  The file is changed immediately on disk.  This
  188. command is normally used with files that are not being visited in
  189. Emacs.  Using it on a file that Emacs is visiting can produce confusing
  190. results, because the file's text inside Emacs does not change while the
  191. file itself changes.
  192.  
  193. 
  194. File: xemacs.info,  Node: Rectangles,  Next: Registers,  Prev: Accumulating Text,  Up: Top
  195.  
  196. Rectangles
  197. ==========
  198.  
  199.    The rectangle commands affect rectangular areas of text: all
  200. characters between a certain pair of columns, in a certain range of
  201. lines.  Commands are provided to kill rectangles, yank killed
  202. rectangles, clear them out, or delete them.  Rectangle commands are
  203. useful with text in multicolumnar formats, like code with comments at
  204. the right, or for changing text into or out of such formats.
  205.  
  206.    To specify the rectangle a command should work on, put the mark at
  207. one corner and point at the opposite corner.  The specified rectangle is
  208. called the "region-rectangle" because it is controlled about the same
  209. way the region is controlled.  Remember that a given combination of
  210. point and mark values can be interpreted either as specifying a region
  211. or as specifying a rectangle; it is up to the command that uses them to
  212. choose the interpretation.
  213.  
  214. `M-x delete-rectangle'
  215.      Delete the text of the region-rectangle, moving any following text
  216.      on each line leftward to the left edge of the region-rectangle.
  217.  
  218. `M-x kill-rectangle'
  219.      Similar, but also save the contents of the region-rectangle as the
  220.      "last killed rectangle".
  221.  
  222. `M-x yank-rectangle'
  223.      Yank the last killed rectangle with its upper left corner at point.
  224.  
  225. `M-x open-rectangle'
  226.      Insert blank space to fill the space of the region-rectangle.  The
  227.      previous contents of the region-rectangle are pushed rightward.
  228.  
  229. `M-x clear-rectangle'
  230.      Clear the region-rectangle by replacing its contents with spaces.
  231.  
  232.    The rectangle operations fall into two classes: commands deleting and
  233. moving rectangles, and commands for blank rectangles.
  234.  
  235.    There are two ways to get rid of the text in a rectangle: you can
  236. discard the text (delete it) or save it as the "last killed" rectangle.
  237. The commands for these two ways are `M-x delete-rectangle' and `M-x
  238. kill-rectangle'.  In either case, the portion of each line that falls
  239. inside the rectangle's boundaries is deleted, causing following text
  240. (if any) on the line to move left.
  241.  
  242.    Note that "killing" a rectangle is not killing in the usual sense;
  243. the rectangle is not stored in the kill ring, but in a special place
  244. that only records the most recently killed rectangle (that is, does not
  245. append to a killed rectangle).  Different yank commands have to be used
  246. and only one rectangle is stored, because yanking a rectangle is quite
  247. different from yanking linear text and yank-popping commands are
  248. difficult to make sense of.
  249.  
  250.    Inserting a rectangle is the opposite of deleting one.  You specify
  251. where to put the upper left corner by putting point there.  The
  252. rectangle's first line is inserted at point, the rectangle's second line
  253. is inserted at a point one line vertically down, and so on.  The number
  254. of lines affected is determined by the height of the saved rectangle.
  255.  
  256.    To insert the last killed rectangle, type `M-x yank-rectangle'.
  257. This can be used to convert single-column lists into double-column
  258. lists; kill the second half of the list as a rectangle and then yank it
  259. beside the first line of the list.
  260.  
  261.    There are two commands for working with blank rectangles: `M-x
  262. clear-rectangle' erases existing text, and `M-x open-rectangle' inserts
  263. a blank rectangle.  Clearing a rectangle is equivalent to deleting it
  264. and then inserting a blank rectangle of the same size.
  265.  
  266.    Rectangles can also be copied into and out of registers.  *Note
  267. Rectangle Registers: RegRect.
  268.  
  269. 
  270. File: xemacs.info,  Node: Registers,  Next: Display,  Prev: Rectangles,  Up: Top
  271.  
  272. Registers
  273. *********
  274.  
  275.    Emacs "registers" are places in which you can save text or positions
  276. for later use.  Text saved in a register can be copied into the buffer
  277. once or many times; a position saved in a register is used by moving
  278. point to that position.  Rectangles can also be copied into and out of
  279. registers (*note Rectangles::.).
  280.  
  281.    Each register has a name, which is a single character.  A register
  282. can store either a piece of text, a position, or a rectangle, but only
  283. one thing at any given time.  Whatever you store in a register remains
  284. there until you store something else in that register.
  285.  
  286. * Menu:
  287.  
  288. * RegPos::    Saving positions in registers.
  289. * RegText::   Saving text in registers.
  290. * RegRect::   Saving rectangles in registers.
  291.  
  292. `M-x view-register <RET> R'
  293.      Display a description of what register R contains.
  294.  
  295.    `M-x view-register' reads a register name as an argument and then
  296. displays the contents of the specified register.
  297.  
  298. 
  299. File: xemacs.info,  Node: RegPos,  Next: RegText,  Prev: Registers,  Up: Registers
  300.  
  301. Saving Positions in Registers
  302. =============================
  303.  
  304.    Saving a position records a spot in a buffer so you can move back
  305. there later.  Moving to a saved position re-selects the buffer and
  306. moves point to the spot.
  307.  
  308. `C-x r SPC R'
  309.      Save the location of point in register R (`point-to-register').
  310.  
  311. `C-x r j R'
  312.      Jump to the location saved in register R (`register-to-point').
  313.  
  314.    To save the current location of point in a register, choose a name R
  315. and type `C-x r SPC R'.  The register R retains the location thus saved
  316. until you store something else in that register.
  317.  
  318.    The command `C-x r j R' moves point to the location recorded in
  319. register R.  The register is not affected; it continues to record the
  320. same location.  You can jump to the same position using the same
  321. register as often as you want.
  322.  
  323. 
  324. File: xemacs.info,  Node: RegText,  Next: RegRect,  Prev: RegPos,  Up: Registers
  325.  
  326. Saving Text in Registers
  327. ========================
  328.  
  329.    When you want to insert a copy of the same piece of text many times,
  330. it can be impractical to use the kill ring, since each subsequent kill
  331. moves the piece of text further down on the ring.  It becomes hard to
  332. keep track of the argument needed to retrieve the same text with `C-y'.
  333. An alternative is to store the text in a register with `C-x r s'
  334. (`copy-to-register') and then retrieve it with `C-x r g'
  335. (`insert-register').
  336.  
  337. `C-x r s R'
  338.      Copy region into register R (`copy-to-register').
  339.  
  340. `C-x r g R'
  341.      Insert text contents of register R (`insert-register').
  342.  
  343.    `C-x r s R' stores a copy of the text of the region into the
  344. register named R.  Given a numeric argument, `C-x r s' deletes the text
  345. from the buffer as well.
  346.  
  347.    `C-x r g R' inserts the text from register R in the buffer.  By
  348. default it leaves point before the text and places the mark after it.
  349. With a numeric argument, it puts point after the text and the mark
  350. before it.
  351.  
  352. 
  353. File: xemacs.info,  Node: RegRect,  Prev: RegText,  Up: Registers
  354.  
  355. Saving Rectangles in Registers
  356. ==============================
  357.  
  358.    A register can contain a rectangle instead of lines of text.  The
  359. rectangle is represented as a list of strings.  *Note Rectangles::, for
  360. basic information on rectangles and how to specify rectangles in a
  361. buffer.
  362.  
  363. `C-x r r R'
  364.      Copy the region-rectangle into register
  365.      R(`copy-rectangle-to-register').  With a numeric argument, delete
  366.      it as well.
  367.  
  368. `C-x r g R'
  369.      Insert the rectangle stored in register R (if it contains a
  370.      rectangle) (`insert-register').
  371.  
  372.    The `C-x r g' command inserts linear text if the register contains
  373. that, or inserts a rectangle if the register contains one.
  374.  
  375. 
  376. File: xemacs.info,  Node: Display,  Next: Search,  Prev: Registers,  Up: Top
  377.  
  378. Controlling the Display
  379. ***********************
  380.  
  381.    Since only part of a large buffer fits in the window, XEmacs tries
  382. to show the part that is likely to be interesting.  The display control
  383. commands allow you to specify which part of the text you want to see.
  384.  
  385. `C-l'
  386.      Clear frame and redisplay, scrolling the selected window to center
  387.      point vertically within it (`recenter').
  388.  
  389. `C-v'
  390. `pgdn'
  391. `next'
  392.      Scroll forward (a windowful or a specified number of lines)
  393.      (`scroll-up').  On most X keyboards, you can get this
  394.      functionality using the key labelled `Page Down', which generates
  395.      either `next' or `pgdn'.
  396.  
  397. `M-v'
  398. `pgup'
  399. `prior'
  400.      Scroll backward (`scroll-down').  On most X keyboards, you can get
  401.      this functionality using the key labelled `Page Up', which
  402.      generates either `prior' or `pgup'.
  403.  
  404. `ARG C-l'
  405.      Scroll so point is on line ARG (`recenter').
  406.  
  407. `C-x <'
  408. `C-pgdn'
  409. `C-next'
  410.      Scroll text in current window to the left (`scroll-left').
  411.  
  412. `C-x >'
  413. `C-pgup'
  414. `C-prior'
  415.      Scroll to the right (`scroll-right').
  416.  
  417. `C-x $'
  418.      Make deeply indented lines invisible (`set-selective-display').
  419.  
  420. * Menu:
  421.  
  422. * Scrolling::               Moving text up and down in a window.
  423. * Horizontal Scrolling::   Moving text left and right in a window.
  424. * Selective Display::      Hiding lines with lots of indentation.
  425. * Display Vars::           Information on variables for customizing display.
  426.  
  427. 
  428. File: xemacs.info,  Node: Scrolling,  Next: Horizontal Scrolling,  Prev: Display,  Up: Display
  429.  
  430. Scrolling
  431. =========
  432.  
  433.    If a buffer contains text that is too large to fit entirely within
  434. the window that is displaying the buffer, XEmacs shows a contiguous
  435. section of the text.  The section shown always contains point.
  436.  
  437.    "Scrolling" means moving text up or down in the window so that
  438. different parts of the text are visible.  Scrolling forward means that
  439. text moves up, and new text appears at the bottom.  Scrolling backward
  440. moves text down and new text appears at the top.
  441.  
  442.    Scrolling happens automatically if you move point past the bottom or
  443. top of the window.  You can also explicitly request scrolling with the
  444. commands in this section.
  445.  
  446. `C-l'
  447.      Clear frame and redisplay, scrolling the selected window to center
  448.      point vertically within it (`recenter').
  449.  
  450. `C-v'
  451. `pgdn'
  452. `next'
  453.      Scroll forward (a windowful or a specified number of lines)
  454.      (`scroll-up').
  455.  
  456. `M-v'
  457. `pgup'
  458. `prior'
  459.      Scroll backward (`scroll-down').
  460.  
  461. `ARG C-l'
  462.      Scroll so point is on line ARG (`recenter').
  463.  
  464.    The most basic scrolling command is `C-l' (`recenter') with no
  465. argument.  It clears the entire frame and redisplays all windows.  In
  466. addition, it scrolls the selected window so that point is halfway down
  467. from the top of the window.
  468.  
  469.    The scrolling commands `C-v' and `M-v' let you move all the text in
  470. the window up or down a few lines.  `C-v' (`scroll-up') with an
  471. argument shows you that many more lines at the bottom of the window,
  472. moving the text and point up together as `C-l' might.  `C-v' with a
  473. negative argument shows you more lines at the top of the window.
  474. `Meta-v' (`scroll-down') is like `C-v', but moves in the opposite
  475. direction.
  476.  
  477.    To read the buffer a windowful at a time, use `C-v' with no
  478. argument.  `C-v' takes the last two lines at the bottom of the window
  479. and puts them at the top, followed by nearly a whole windowful of lines
  480. not previously visible.  Point moves to the new top of the window if it
  481. was in the text scrolled off the top.  `M-v' with no argument moves
  482. backward with similar overlap.  The number of lines of overlap across a
  483. `C-v' or `M-v' is controlled by the variable
  484. `next-screen-context-lines'; by default, it is two.
  485.  
  486.    Another way to scroll is using `C-l' with a numeric argument.  `C-l'
  487. does not clear the frame when given an argument; it only scrolls the
  488. selected window.  With a positive argument N, `C-l' repositions text to
  489. put point N lines down from the top.  An argument of zero puts point on
  490. the very top line.  Point does not move with respect to the text;
  491. rather, the text and point move rigidly on the frame.  `C-l' with a
  492. negative argument puts point that many lines from the bottom of the
  493. window.  For example, `C-u - 1 C-l' puts point on the bottom line, and
  494. `C-u - 5 C-l' puts it five lines from the bottom.  Just `C-u' as
  495. argument, as in `C-u C-l', scrolls point to the center of the frame.
  496.  
  497.    Scrolling happens automatically if point has moved out of the visible
  498. portion of the text when it is time to display.  Usually scrolling is
  499. done  to put point vertically centered within the window.  However, if
  500. the variable `scroll-step' has a non-zero value, an attempt is made to
  501. scroll the buffer by that many lines; if that is enough to bring point
  502. back into visibility, that is what happens.
  503.  
  504. 
  505. File: xemacs.info,  Node: Horizontal Scrolling,  Prev: Scrolling,  Up: Display
  506.  
  507. Horizontal Scrolling
  508. ====================
  509.  
  510. `C-x <'
  511.      Scroll text in current window to the left (`scroll-left').
  512.  
  513. `C-x >'
  514.      Scroll to the right (`scroll-right').
  515.  
  516.    The text in a window can also be scrolled horizontally.  This means
  517. that each line of text is shifted sideways in the window, and one or
  518. more characters at the beginning of each line are not displayed at all.
  519. When a window has been scrolled horizontally in this way, text lines
  520. are truncated rather than continued (*note Continuation Lines::.), with
  521. a `$' appearing in the first column when there is text truncated to the
  522. left, and in the last column when there is text truncated to the right.
  523.  
  524.    The command `C-x <' (`scroll-left') scrolls the selected window to
  525. the left by N columns with argument N.  With no argument, it scrolls by
  526. almost the full width of the window (two columns less, to be precise).
  527. `C-x >' (`scroll-right') scrolls similarly to the right.  The window
  528. cannot be scrolled any farther to the right once it is displaying
  529. normally (with each line starting at the window's left margin);
  530. attempting to do so has no effect.
  531.  
  532. 
  533. File: xemacs.info,  Node: Selective Display,  Next: Display Vars,  Prev: Display,  Up: Display
  534.  
  535. Selective Display
  536. =================
  537.  
  538.    XEmacs can hide lines indented more than a certain number of columns
  539. (you specify how many columns).  This allows you  to get an overview of
  540. a part of a program.
  541.  
  542.    To hide lines, type `C-x $' (`set-selective-display') with a numeric
  543. argument N.  (*Note Arguments::, for information on giving the
  544. argument.)  Lines with at least N columns of indentation disappear from
  545. the screen.  The only indication of their presence are three dots
  546. (`...'), which appear at the end of each visible line that is followed
  547. by one or more invisible ones.
  548.  
  549.    The invisible lines are still present in the buffer, and most editing
  550. commands see them as usual, so it is very easy to put point in the
  551. middle of invisible text.  When this happens, the cursor appears at the
  552. end of the previous line, after the three dots.  If point is at the end
  553. of the visible line, before the newline that ends it, the cursor
  554. appears before the three dots.
  555.  
  556.    The commands `C-n' and `C-p' move across the invisible lines as if
  557. they were not there.
  558.  
  559.    To make everything visible again, type `C-x $' with no argument.
  560.  
  561. 
  562. File: xemacs.info,  Node: Display Vars,  Prev: Selective Display,  Up: Display
  563.  
  564. Variables Controlling Display
  565. =============================
  566.  
  567.    This section contains information for customization only.  Beginning
  568. users should skip it.
  569.  
  570.    When you reenter XEmacs after suspending, XEmacs normally clears the
  571. screen and redraws the entire display.  On some terminals with more than
  572. one page of memory, it is possible to arrange the termcap entry so that
  573. the `ti' and `te' strings (output to the terminal when XEmacs is
  574. entered and exited, respectively) switch between pages of memory so as
  575. to use one page for XEmacs and another page for other output.  In that
  576. case, you might want to set the variable `no-redraw-on-reenter' to
  577. non-`nil' so that XEmacs will assume, when resumed, that the screen
  578. page it is using still contains what XEmacs last wrote there.
  579.  
  580.    The variable `echo-keystrokes' controls the echoing of
  581. multi-character keys; its value is the number of seconds of pause
  582. required to cause echoing to start, or zero, meaning don't echo at all.
  583. *Note Echo Area::.
  584.  
  585.    If the variable `ctl-arrow' is `nil', control characters in the
  586. buffer are displayed with octal escape sequences, all except newline and
  587. tab.  If its value is `t', then control characters will be printed with
  588. an up-arrow, for example `^A'.
  589.  
  590.    If its value is not `t' and not `nil', then characters whose code is
  591. greater than 160 (that is, the space character (32) with its high bit
  592. set) will be assumed to be printable, and will be displayed without
  593. alteration.  This is the default when running under X Windows, since
  594. XEmacs assumes an ISO/8859-1 character set (also known as "Latin1").
  595. The `ctl-arrow' variable may also be set to an integer, in which case
  596. all characters whose codes are greater than or equal to that value will
  597. be assumed to be printable.
  598.  
  599.    Altering the value of `ctl-arrow' makes it local to the current
  600. buffer; until that time, the default value is in effect.  *Note
  601. Locals::.
  602.  
  603.    Normally, a tab character in the buffer is displayed as whitespace
  604. which extends to the next display tab stop position, and display tab
  605. stops come at intervals equal to eight spaces.  The number of spaces
  606. per tab is controlled by the variable `tab-width', which is made local
  607. by changing it, just like `ctl-arrow'.  Note that how the tab character
  608. in the buffer is displayed has nothing to do with the definition of
  609. <TAB> as a command.
  610.  
  611.    If you set the variable `selective-display-ellipses' to `nil', the
  612. three dots at the end of a line that precedes invisible lines do not
  613. appear.  There is no visible indication of the invisible lines.  This
  614. variable becomes local automatically when set.
  615.  
  616. 
  617. File: xemacs.info,  Node: Search,  Next: Fixit,  Prev: Display,  Up: Top
  618.  
  619. Searching and Replacement
  620. *************************
  621.  
  622.    Like other editors, Emacs has commands for searching for occurrences
  623. of a string.  The principal search command is unusual in that it is
  624. "incremental": it begins to search before you have finished typing the
  625. search string.  There are also non-incremental search commands more like
  626. those of other editors.
  627.  
  628.    Besides the usual `replace-string' command that finds all
  629. occurrences of one string and replaces them with another, Emacs has a
  630. fancy replacement command called `query-replace' which asks
  631. interactively which occurrences to replace.
  632.  
  633. * Menu:
  634.  
  635. * Incremental Search::     Search happens as you type the string.
  636. * Non-Incremental Search:: Specify entire string and then search.
  637. * Word Search::            Search for sequence of words.
  638. * Regexp Search::          Search for match for a regexp.
  639. * Regexps::                Syntax of regular expressions.
  640. * Search Case::            To ignore case while searching, or not.
  641. * Replace::                Search, and replace some or all matches.
  642. * Other Repeating Search:: Operating on all matches for some regexp.
  643.  
  644. 
  645. File: xemacs.info,  Node: Incremental Search,  Next: Non-Incremental Search,  Prev: Search,  Up: Search
  646.  
  647. Incremental Search
  648. ==================
  649.  
  650.    An incremental search begins searching as soon as you type the first
  651. character of the search string.  As you type in the search string, Emacs
  652. shows you where the string (as you have typed it so far) is found.
  653. When you have typed enough characters to identify the place you want,
  654. you can stop.  Depending on what you do next, you may or may not need to
  655. terminate the search explicitly with a <RET>.
  656.  
  657. `C-s'
  658.      Incremental search forward (`isearch-forward').
  659.  
  660. `C-r'
  661.      Incremental search backward (`isearch-backward').
  662.  
  663.    `C-s' starts an incremental search.  `C-s' reads characters from the
  664. keyboard and positions the cursor at the first occurrence of the
  665. characters that you have typed.  If you type `C-s' and then `F', the
  666. cursor moves right after the first `F'.  Type an `O', and see the
  667. cursor move to after the first `FO'.  After another `O', the cursor is
  668. after the first `FOO' after the place where you started the search.
  669. Meanwhile, the search string `FOO' has been echoed in the echo area.
  670.  
  671.    The echo area display ends with three dots when actual searching is
  672. going on.  When search is waiting for more input, the three dots are
  673. removed.  (On slow terminals, the three dots are not displayed.)
  674.  
  675.    If you make a mistake in typing the search string, you can erase
  676. characters with <DEL>.  Each <DEL> cancels the last character of the
  677. search string.  This does not happen until Emacs is ready to read
  678. another input character; first it must either find, or fail to find,
  679. the character you want to erase.  If you do not want to wait for this
  680. to happen, use `C-g' as described below.
  681.  
  682.    When you are satisfied with the place you have reached, you can type
  683. <RET> (or <C-m>), which stops searching, leaving the cursor where the
  684. search brought it.  Any command not specially meaningful in searches
  685. also stops the search and is then executed.  Thus, typing `C-a' exits
  686. the search and then moves to the beginning of the line.  <RET> is
  687. necessary only if the next command you want to type is a printing
  688. character, <DEL>, <ESC>, or another control character that is special
  689. within searches (`C-q', `C-w', `C-r', `C-s', or `C-y').
  690.  
  691.    Sometimes you search for `FOO' and find it, but were actually
  692. looking for a different occurance of it.  To move to the next occurrence
  693. of the search string, type another `C-s'.  Do this as often as
  694. necessary.  If you overshoot, you can cancel some `C-s' characters with
  695. <DEL>.
  696.  
  697.    After you exit a search, you can search for the same string again by
  698. typing just `C-s C-s': the first `C-s' is the key that invokes
  699. incremental search, and the second `C-s' means "search again".
  700.  
  701.    If the specified string is not found at all, the echo area displays
  702. the text `Failing I-Search'.  The cursor is after the place where Emacs
  703. found as much of your string as it could.  Thus, if you search for
  704. `FOOT', and there is no `FOOT', the cursor may be after the `FOO' in
  705. `FOOL'.  At this point there are several things you can do.  If you
  706. mistyped the search string, correct it.  If you like the place you have
  707. found, you can type <RET> or some other Emacs command to "accept what
  708. the search offered".  Or you can type `C-g', which removes from the
  709. search string the characters that could not be found (the `T' in
  710. `FOOT'), leaving those that were found (the `FOO' in `FOOT').  A second
  711. `C-g' at that point cancels the search entirely, returning point to
  712. where it was when the search started.
  713.  
  714.    If a search is failing and you ask to repeat it by typing another
  715. `C-s', it starts again from the beginning of the buffer.  Repeating a
  716. failing backward search with `C-r' starts again from the end.  This is
  717. called "wrapping around".  `Wrapped' appears in the search prompt once
  718. this has happened.
  719.  
  720.    The `C-g' "quit" character does special things during searches; just
  721. what it does depends on the status of the search.  If the search has
  722. found what you specified and is waiting for input, `C-g' cancels the
  723. entire search.  The cursor moves back to where you started the search.
  724. If `C-g' is typed when there are characters in the search string that
  725. have not been found--because Emacs is still searching for them, or
  726. because it has failed to find them--then the search string characters
  727. which have not been found are discarded from the search string.  The
  728. search is now successful and waiting for more input, so a second `C-g'
  729. cancels the entire search.
  730.  
  731.    To search for a control character such as `C-s' or <DEL> or <ESC>,
  732. you must quote it by typing `C-q' first.  This function of `C-q' is
  733. analogous to its meaning as an Emacs command: it causes the following
  734. character to be treated the way a graphic character would normally be
  735. treated in the same context.
  736.  
  737.    To search backwards, you can use `C-r' instead of `C-s' to start the
  738. search; `C-r' is the key that runs the command (`isearch-backward') to
  739. search backward.  You can also use `C-r' to change from searching
  740. forward to searching backwards.  Do this if a search fails because the
  741. place you started was too far down in the file.  Repeated `C-r' keeps
  742. looking for more occurrences backwards.  `C-s' starts going forward
  743. again.  You can cancel `C-r' in a search with <DEL>.
  744.  
  745.    The characters `C-y' and `C-w' can be used in incremental search to
  746. grab text from the buffer into the search string.  This makes it
  747. convenient to search for another occurrence of text at point.  `C-w'
  748. copies the word after point as part of the search string, advancing
  749. point over that word.  Another `C-s' to repeat the search will then
  750. search for a string including that word.  `C-y' is similar to `C-w' but
  751. copies the rest of the current line into the search string.
  752.  
  753.    The characters `M-p' and `M-n' can be used in an incremental search
  754. to recall things which you have searched for in the past.  A list of
  755. the last 16 things you have searched for is retained, and `M-p' and
  756. `M-n' let you cycle through that ring.
  757.  
  758.    The character `M-<TAB>' does completion on the elements in the
  759. search history ring.  For example, if you know that you have recently
  760. searched for the string `POTATOE', you could type `C-s P O M-<TAB>'.
  761. If you had searched for other strings beginning with `PO' then you
  762. would be shown a list of them, and would need to type more to select
  763. one.
  764.  
  765.    You can change any of the special characters in incremental search
  766. via the normal keybinding mechanism: simply add a binding to the
  767. `isearch-mode-map'.  For example, to make the character `C-b' mean
  768. "search backwards" while in isearch-mode, do this:
  769.  
  770.      (define-key isearch-mode-map "\C-b" 'isearch-repeat-backward)
  771.  
  772.    These are the default bindings of isearch-mode:
  773.  
  774. `DEL'
  775.      Delete a character from the incremental search string
  776.      (`isearch-delete-char').
  777.  
  778. `RET'
  779.      Exit incremental search (`isearch-exit').
  780.  
  781. `C-q'
  782.      Quote special characters for incremental search
  783.      (`isearch-quote-char').
  784.  
  785. `C-s'
  786.      Repeat incremental search forward (`isearch-repeat-forward').
  787.  
  788. `C-r'
  789.      Repeat incremental search backward (`isearch-repeat-backward').
  790.  
  791. `C-y'
  792.      Pull rest of line from buffer into search string
  793.      (`isearch-yank-line').
  794.  
  795. `C-w'
  796.      Pull next word from buffer into search string
  797.      (`isearch-yank-word').
  798.  
  799. `C-g'
  800.      Cancels input back to what has been found successfully, or aborts
  801.      the isearch (`isearch-abort').
  802.  
  803. `M-p'
  804.      Recall the previous element in the isearch history ring
  805.      (`isearch-ring-retreat').
  806.  
  807. `M-n'
  808.      Recall the next element in the isearch history ring
  809.      (`isearch-ring-advance').
  810.  
  811. `M-<TAB>'
  812.      Do completion on the elements in the isearch history ring
  813.      (`isearch-complete').
  814.  
  815.    Any other character which is normally inserted into a buffer when
  816. typed is automatically added to the search string in isearch-mode.
  817.  
  818. Slow Terminal Incremental Search
  819. --------------------------------
  820.  
  821.    Incremental search on a slow terminal uses a modified style of
  822. display that is designed to take less time.  Instead of redisplaying
  823. the buffer at each place the search gets to, it creates a new
  824. single-line window and uses that to display the line the search has
  825. found.  The single-line window appears as soon as point gets outside of
  826. the text that is already on the screen.
  827.  
  828.    When the search is terminated, the single-line window is removed.
  829. Only at this time the window in which the search was done is
  830. redisplayed to show its new value of point.
  831.  
  832.    The three dots at the end of the search string, normally used to
  833. indicate that searching is going on, are not displayed in slow style
  834. display.
  835.  
  836.    The slow terminal style of display is used when the terminal baud
  837. rate is less than or equal to the value of the variable
  838. `search-slow-speed', initially 1200.
  839.  
  840.    The number of lines to use in slow terminal search display is
  841. controlled by the variable `search-slow-window-lines'.  Its normal
  842. value is 1.
  843.  
  844. 
  845. File: xemacs.info,  Node: Non-Incremental Search,  Next: Word Search,  Prev: Incremental Search,  Up: Search
  846.  
  847. Non-Incremental Search
  848. ======================
  849.  
  850.    Emacs also has conventional non-incremental search commands, which
  851. require you type the entire search string before searching begins.
  852.  
  853. `C-s <RET> STRING <RET>'
  854.      Search for STRING.
  855.  
  856. `C-r <RET> STRING <RET>'
  857.      Search backward for STRING.
  858.  
  859.    To do a non-incremental search, first type `C-s <RET>' (or `C-s
  860. C-m').  This enters the minibuffer to read the search string.
  861. Terminate the string with <RET> to start the search.  If the string is
  862. not found, the search command gets an error.
  863.  
  864.    By default, `C-s' invokes incremental search, but if you give it an
  865. empty argument, which would otherwise be useless, it invokes
  866. non-incremental search.  Therefore, `C-s <RET>' invokes non-incremental
  867. search.  `C-r <RET>' also works this way.
  868.  
  869.    Forward and backward non-incremental searches are implemented by the
  870. commands `search-forward' and `search-backward'.  You can bind these
  871. commands to keys.  The reason that incremental search is programmed to
  872. invoke them as well is that `C-s <RET>' is the traditional sequence of
  873. characters used in Emacs to invoke non-incremental search.
  874.  
  875.    Non-incremental searches performed using `C-s <RET>' do not call
  876. `search-forward' right away.  They first check if the next character is
  877. `C-w', which requests a word search.  *Note Word Search::.
  878.  
  879. 
  880. File: xemacs.info,  Node: Word Search,  Next: Regexp Search,  Prev: Non-Incremental Search,  Up: Search
  881.  
  882. Word Search
  883. ===========
  884.  
  885.    Word search looks for a sequence of words without regard to how the
  886. words are separated.  More precisely, you type a string of many words,
  887. using single spaces to separate them, and the string is found even if
  888. there are multiple spaces, newlines or other punctuation between the
  889. words.
  890.  
  891.    Word search is useful in editing documents formatted by text
  892. formatters.  If you edit while looking at the printed, formatted
  893. version, you can't tell where the line breaks are in the source file.
  894. Word search, allows you to search  without having to know the line
  895. breaks.
  896.  
  897. `C-s <RET> C-w WORDS <RET>'
  898.      Search for WORDS, ignoring differences in punctuation.
  899.  
  900. `C-r <RET> C-w WORDS <RET>'
  901.      Search backward for WORDS, ignoring differences in punctuation.
  902.  
  903.    Word search is a special case of non-incremental search.  It is
  904. invoked with `C-s <RET> C-w' followed by the search string, which must
  905. always be terminated with another <RET>.  Being non-incremental, this
  906. search does not start until the argument is terminated.  It works by
  907. constructing a regular expression and searching for that.  *Note Regexp
  908. Search::.
  909.  
  910.    You can do a backward word search with `C-r <RET> C-w'.
  911.  
  912.    Forward and backward word searches are implemented by the commands
  913. `word-search-forward' and `word-search-backward'.  You can bind these
  914. commands to keys.  The reason that incremental search is programmed to
  915. invoke them as well is that `C-s <RET> C-w' is the traditional Emacs
  916. sequence of keys for word search.
  917.  
  918. 
  919. File: xemacs.info,  Node: Regexp Search,  Next: Regexps,  Prev: Word Search,  Up: Search
  920.  
  921. Regular Expression Search
  922. =========================
  923.  
  924.    A "regular expression" ("regexp", for short) is a pattern that
  925. denotes a set of strings, possibly an infinite set.  Searching for
  926. matches for a regexp is a powerful operation that editors on Unix
  927. systems have traditionally offered.  In XEmacs, you can search for the
  928. next match for a regexp either incrementally or not.
  929.  
  930.    Incremental search for a regexp is done by typing `M-C-s'
  931. (`isearch-forward-regexp').  This command reads a search string
  932. incrementally just like `C-s', but it treats the search string as a
  933. regexp rather than looking for an exact match against the text in the
  934. buffer.  Each time you add text to the search string, you make the
  935. regexp longer, and the new regexp is searched for.  A reverse regexp
  936. search command `isearch-backward-regexp' also exists, but no key runs
  937. it.
  938.  
  939.    All of the control characters that do special things within an
  940. ordinary incremental search have the same functionality in incremental
  941. regexp search.  Typing `C-s' or `C-r' immediately after starting a
  942. search retrieves the last incremental search regexp used: incremental
  943. regexp and non-regexp searches have independent defaults.
  944.  
  945.    Non-incremental search for a regexp is done by the functions
  946. `re-search-forward' and `re-search-backward'.  You can invoke them with
  947. `M-x' or bind them to keys.  You can also call `re-search-forward' by
  948. way of incremental regexp search with `M-C-s <RET>'.
  949.  
  950. 
  951. File: xemacs.info,  Node: Regexps,  Next: Search Case,  Prev: Regexp Search,  Up: Search
  952.  
  953. Syntax of Regular Expressions
  954. =============================
  955.  
  956.    Regular expressions have a syntax in which a few characters are
  957. special constructs and the rest are "ordinary".  An ordinary character
  958. is a simple regular expression which matches that character and nothing
  959. else.  The special characters are `$', `^', `.', `*', `+', `?', `[',
  960. `]' and `\'; no new special characters will be defined.  Any other
  961. character appearing in a regular expression is ordinary, unless a `\'
  962. precedes it.
  963.  
  964.    For example, `f' is not a special character, so it is ordinary, and
  965. therefore `f' is a regular expression that matches the string `f' and
  966. no other string.  (It does not match the string `ff'.)  Likewise, `o'
  967. is a regular expression that matches only `o'.
  968.  
  969.    Any two regular expressions A and B can be concatenated.  The result
  970. is a regular expression which matches a string if A matches some amount
  971. of the beginning of that string and B matches the rest of the string.
  972.  
  973.    As a simple example, you can concatenate the regular expressions `f'
  974. and `o' to get the regular expression `fo', which matches only the
  975. string `fo'.  To do something nontrivial, you need to use one of the
  976. following special characters:
  977.  
  978. `. (Period)'
  979.      is a special character that matches any single character except a
  980.      newline.  Using concatenation, you can make regular expressions
  981.      like `a.b', which matches any three-character string which begins
  982.      with `a' and ends with `b'.
  983.  
  984. `*'
  985.      is not a construct by itself; it is a suffix, which means the
  986.      preceding regular expression is to be repeated as many times as
  987.      possible.  In `fo*', the `*' applies to the `o', so `fo*' matches
  988.      one `f' followed by any number of `o's.  The case of zero `o's is
  989.      allowed: `fo*' does match `f'.
  990.  
  991.      `*' always applies to the smallest possible preceding expression.
  992.      Thus, `fo*' has a repeating `o', not a repeating `fo'.
  993.  
  994.      The matcher processes a `*' construct by immediately matching as
  995.      many repetitions as it can find.  Then it continues with the rest
  996.      of the pattern.  If that fails, backtracking occurs, discarding
  997.      some of the matches of the `*'-modified construct in case that
  998.      makes it possible to match the rest of the pattern.  For example,
  999.      matching `ca*ar' against the string `caaar', the `a*' first tries
  1000.      to match all three `a's; but the rest of the pattern is `ar' and
  1001.      there is only `r' left to match, so this try fails.  The next
  1002.      alternative is for `a*' to match only two `a's.  With this choice,
  1003.      the rest of the regexp matches successfully.
  1004.  
  1005. `+'
  1006.      is a suffix character similar to `*' except that it requires that
  1007.      the preceding expression be matched at least once.  For example,
  1008.      `ca+r' will match the strings `car' and `caaaar' but not the
  1009.      string `cr', whereas `ca*r' would match all three strings.
  1010.  
  1011. `?'
  1012.      is a suffix character similar to `*' except that it can match the
  1013.      preceding expression either once or not at all.  For example,
  1014.      `ca?r' will match `car' or `cr'; nothing else.
  1015.  
  1016. `[ ... ]'
  1017.      `[' begins a "character set", which is terminated by a `]'.  In
  1018.      the simplest case, the characters between the two form the set.
  1019.      Thus, `[ad]' matches either one `a' or one `d', and `[ad]*'
  1020.      matches any string composed of just `a's and `d's (including the
  1021.      empty string), from which it follows that `c[ad]*r' matches `cr',
  1022.      `car', `cdr', `caddaar', etc.
  1023.  
  1024.      You can include character ranges in a character set by writing two
  1025.      characters with a `-' between them.  Thus, `[a-z]' matches any
  1026.      lower-case letter.  Ranges may be intermixed freely with individual
  1027.      characters, as in `[a-z$%.]', which matches any lower-case letter
  1028.      or `$', `%', or period.
  1029.  
  1030.      Note that inside a character set the usual special characters are
  1031.      not special any more.  A completely different set of special
  1032.      characters exists inside character sets: `]', `-', and `^'.
  1033.  
  1034.      To include a `]' in a character set, you must make it the first
  1035.      character.  For example, `[]a]' matches `]' or `a'.  To include a
  1036.      `-', write `---', which is a range containing only `-'.  To
  1037.      include `^', make it other than the first character in the set.
  1038.  
  1039. `[^ ... ]'
  1040.      `[^' begins a "complement character set", which matches any
  1041.      character except the ones specified.  Thus, `[^a-z0-9A-Z]' matches
  1042.      all characters except letters and digits.
  1043.  
  1044.      `^' is not special in a character set unless it is the first
  1045.      character.  The character following the `^' is treated as if it
  1046.      were first (`-' and `]' are not special there).
  1047.  
  1048.      Note that a complement character set can match a newline, unless
  1049.      newline is mentioned as one of the characters not to match.
  1050.  
  1051. `^'
  1052.      is a special character that matches the empty string, but only if
  1053.      at the beginning of a line in the text being matched.  Otherwise,
  1054.      it fails to match anything.  Thus, `^foo' matches a `foo' that
  1055.      occurs at the beginning of a line.
  1056.  
  1057. `$'
  1058.      is similar to `^' but matches only at the end of a line.  Thus,
  1059.      `xx*$' matches a string of one `x' or more at the end of a line.
  1060.  
  1061. `\'
  1062.      does two things: it quotes the special characters (including `\'),
  1063.      and it introduces additional special constructs.
  1064.  
  1065.      Because `\' quotes special characters, `\$' is a regular
  1066.      expression that matches only `$', and `\[' is a regular expression
  1067.      that matches only `[', and so on.
  1068.  
  1069.    Note: for historical compatibility, special characters are treated as
  1070. ordinary ones if they are in contexts where their special meanings make
  1071. no sense.  For example, `*foo' treats `*' as ordinary since there is no
  1072. preceding expression on which the `*' can act.  It is poor practice to
  1073. depend on this behavior; better to quote the special character anyway,
  1074. regardless of where is appears.
  1075.  
  1076.    Usually, `\' followed by any character matches only that character.
  1077. However, there are several exceptions: characters which, when preceded
  1078. by `\', are special constructs.  Such characters are always ordinary
  1079. when encountered on their own.  Here is a table of `\' constructs.
  1080.  
  1081. `\|'
  1082.      specifies an alternative.  Two regular expressions A and B with
  1083.      `\|' in between form an expression that matches anything A or B
  1084.      matches.
  1085.  
  1086.      Thus, `foo\|bar' matches either `foo' or `bar' but no other string.
  1087.  
  1088.      `\|' applies to the largest possible surrounding expressions.
  1089.      Only a surrounding `\( ... \)' grouping can limit the grouping
  1090.      power of `\|'.
  1091.  
  1092.      Full backtracking capability exists to handle multiple uses of
  1093.      `\|'.
  1094.  
  1095. `\( ... \)'
  1096.      is a grouping construct that serves three purposes:
  1097.  
  1098.        1. To enclose a set of `\|' alternatives for other operations.
  1099.           Thus, `\(foo\|bar\)x' matches either `foox' or `barx'.
  1100.  
  1101.        2. To enclose a complicated expression for the postfix `*' to
  1102.           operate on.  Thus, `ba\(na\)*' matches `bananana', etc., with
  1103.           any (zero or more) number of `na' strings.
  1104.  
  1105.        3. To mark a matched substring for future reference.
  1106.  
  1107.  
  1108.      This last application is not a consequence of the idea of a
  1109.      parenthetical grouping; it is a separate feature which happens to
  1110.      be assigned as a second meaning to the same `\( ... \)' construct
  1111.      because in practice there is no conflict between the two meanings.
  1112.      Here is an explanation:
  1113.  
  1114. `\DIGIT'
  1115.      after the end of a `\( ... \)' construct, the matcher remembers the
  1116.      beginning and end of the text matched by that construct.  Then,
  1117.      later on in the regular expression, you can use `\' followed by
  1118.      DIGIT to mean "match the same text matched the DIGIT'th time by the
  1119.      `\( ... \)' construct."
  1120.  
  1121.      The strings matching the first nine `\( ... \)' constructs
  1122.      appearing in a regular expression are assigned numbers 1 through 9
  1123.      in order that the open-parentheses appear in the regular
  1124.      expression.  `\1' through `\9' may be used to refer to the text
  1125.      matched by the corresponding `\( ... \)' construct.
  1126.  
  1127.      For example, `\(.*\)\1' matches any newline-free string that is
  1128.      composed of two identical halves.  The `\(.*\)' matches the first
  1129.      half, which may be anything, but the `\1' that follows must match
  1130.      the same exact text.
  1131.  
  1132. `\`'
  1133.      matches the empty string, provided it is at the beginning of the
  1134.      buffer.
  1135.  
  1136. `\''
  1137.      matches the empty string, provided it is at the end of the buffer.
  1138.  
  1139. `\b'
  1140.      matches the empty string, provided it is at the beginning or end
  1141.      of a word.  Thus, `\bfoo\b' matches any occurrence of `foo' as a
  1142.      separate word.  `\bballs?\b' matches `ball' or `balls' as a
  1143.      separate word.
  1144.  
  1145. `\B'
  1146.      matches the empty string, provided it is not at the beginning or
  1147.      end of a word.
  1148.  
  1149. `\<'
  1150.      matches the empty string, provided it is at the beginning of a
  1151.      word.
  1152.  
  1153. `\>'
  1154.      matches the empty string, provided it is at the end of a word.
  1155.  
  1156. `\w'
  1157.      matches any word-constituent character.  The editor syntax table
  1158.      determines which characters these are.
  1159.  
  1160. `\W'
  1161.      matches any character that is not a word-constituent.
  1162.  
  1163. `\sCODE'
  1164.      matches any character whose syntax is CODE.  CODE is a character
  1165.      which represents a syntax code: thus, `w' for word constituent,
  1166.      `-' for whitespace, `(' for open-parenthesis, etc.  *Note Syntax::.
  1167.  
  1168. `\SCODE'
  1169.      matches any character whose syntax is not CODE.
  1170.  
  1171.    Here is a complicated regexp used by Emacs to recognize the end of a
  1172. sentence together with any whitespace that follows.  It is given in Lisp
  1173. syntax to enable you to distinguish the spaces from the tab characters.
  1174. In Lisp syntax, the string constant begins and ends with a
  1175. double-quote.  `\"' stands for a double-quote as part of the regexp,
  1176. `\\' for a backslash as part of the regexp, `\t' for a tab and `\n' for
  1177. a newline.
  1178.  
  1179.      "[.?!][]\"')]*\\($\\|\t\\|  \\)[ \t\n]*"
  1180.  
  1181. This regexp contains four parts: a character set matching period, `?'
  1182. or `!'; a character set matching close-brackets, quotes or parentheses,
  1183. repeated any number of times; an alternative in backslash-parentheses
  1184. that matches end-of-line, a tab or two spaces; and a character set
  1185. matching whitespace characters, repeated any number of times.
  1186.  
  1187.